const express = require('express');
const router = express.Router();
const {
   getGroups,
   createGroup,
   getGroup,
   updateGroup,
   removeGroup,
   genIntiveCode,
   joinGroupByCode
} = require('../route-handlers/groups');

router.route('/:id').get(getGroup).patch(updateGroup).delete(removeGroup);
router.route('/').get(getGroups).post(createGroup);
router.route('/genCode').post(genIntiveCode)
router.route('/join').post(joinGroupByCode);


module.exports = router;
